- if @project.mirror? && can?(current_user, :push_code, @project)
  .gl-mb-3
    - if @project.import_state.mirror_update_due?
      %span.btn.gl-button.btn-default.disabled
        = sprite_icon('retry', css_class: 'spin gl-mr-3')
        = _('Update Scheduled…')
    - elsif @project.import_state.updating_mirror?
      %span.btn.gl-button.btn-default.disabled
        = sprite_icon('retry', css_class: 'spin gl-mr-3')
        = _('Updating…')
    - elsif can?(current_user, :admin_project, @project)
      = link_to update_now_project_mirror_path(@project), method: :post, class: 'gl-button btn btn-default' do
        = sprite_icon('retry', css_class: 'gl-mr-3')
        = _('Update Now')
    - else
      %span.btn.gl-button.btn-default.disabled
        = sprite_icon('retry', css_class: 'gl-mr-3')
        = _('Update Now')
    - if @project.mirror_last_update_succeeded?
      %p.inline.gl-ml-3
        = _('Successfully updated %{last_updated_timeago}.').html_safe % { last_updated_timeago: time_ago_with_tooltip(@project.import_state.last_successful_update_at) }
